Integrated circuit that processes communication packets with co-processor circuitry to correlate a packet stream with context information

ABSTRACT

An integrated circuit comprises co-processor circuitry and a core processor. The co-processor circuitry comprises context buffers and data buffers. The co-processor circuitry receives and stores one of the communication packets in one of the data buffers. The co-processor circuitry correlates the one communication packet with one of a plurality of channel descriptors. The co-processor circuitry associates the one data buffer with one of the context buffers holding the one channel descriptor to maintain the correlation between the one communication packet and the one channel descriptor. The co-processor circuitry prevents multiple valid copies of the one channel descriptor from existing in the context buffers. In some examples of the invention, this is accomplished by tracking a number of the data buffers associated with the one context buffer. The core processor executes a packet processing software application that directs the processor to process the one communication packet in the one data buffer based on the one channel descriptor in the one context buffer.

RELATED CASES

This application is related to United States provisional patentapplication 60/149,376, entitled “HIGH SPEED COMMUNICATIONS PROCESSINGDEVICE FOR INTERNET PROTOCOL, ASYNCHRONOUS TRANSFER MODE, FRAME RELAY,AND SONET COMMUNICATIONS”, filed on Aug. 17, 1999, and which is herebyincorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention is related to the field of communications, and inparticular, to integrated circuits that process communication packets.

2. Statement of the Problem

Communications systems transfer information in packet streams. Thepackets in the streams each contain a header and a payload. The headercontains control information, such as addressing or channel information,that indicate how the packet should be handled. The payload contains theinformation that is being transferred. Some packets are broken intosegments for processing. The term “packet” is intended to include packetsegments. Some examples of packets include, Asynchronous Transfer Mode(ATM) cells, Internet Protocol (IP) packets, frame relay packets,Ethernet packets, or some other packet-like information block.

An integrated circuit known as a stream processor has been developedrecently to address the special needs of packet communicationnetworking. Traffic stream processors are designed to apply robustfunctionality to extremely high-speed packet streams. This dual designrequirement is often in conflict because the high-speeds limit the levelof functionality that can be applied to the packet stream.

Robust functionality is critical with today's diverse but convergingcommunication systems. Stream processors must handle multiple protocolsand interwork between streams of different protocols. Stream processorsmust also ensure that quality-of-service constraints are met withrespect to bandwidth and priority. Each stream should receive thebandwidth allocation and priority that is defined in correspondingservice level agreements. This functionality must be applied differentlyto different streams—possibly thousands of different streams.

To provide such functionality, a RISC-based core processor was developedwith its own network-oriented instruction set. The instruction set isdesigned to accomplish common networking tasks in the fewest cycles. Thecore processor executes software applications built from the instructionset to apply the robust functionality to high-speed packet streams.

To determine how the packets should be handled, the core processorconstantly correlates packets with their respective context information.The core processor then retrieves the correlated context informationfrom off-chip memory. Typically, expensive off-chip memory systems arerequired to speed up this process. When handling multiple packets, thecore processor must maintain the coherency of the context information asthe context information changes in a pipe-lined processing environment.Given the high-speeds of the packet streams, this function places aheavy burden on the core processor and expends critical processingcapacity. Instead of providing additional quality-of-service processing,the core processor spends time correlating packets with contextinformation, retrieving the correlated context information, andmaintaining the coherency of the context information.

SUMMARY OF THE SOLUTION

The invention helps solve the above problems with an integrated circuitthat processes communication packets and can function as a trafficstream processor. The integrated circuit uses co-processor circuitry tocorrelate packets with respective context information and transfer thecorrelated context information to an on-chip context buffer. Cheaperoff-chip memory systems can be used for context information because thelatency of context retrieval is hidden from the core processor. Theco-processor circuitry also maintains the coherency of the contextinformation by preventing multiple copies from existing. The processingcapacity savings can be used to handle higher-speed streams or increasethe available functionality.

The integrated circuit comprises co-processor circuitry and a coreprocessor. The co-processor circuitry comprises context buffers and databuffers. The co-processor circuitry receives and stores one of thecommunication packets in one of the data buffers. The co-processorcircuitry correlates the one communication packet with one of aplurality of channel descriptors. The co-processor circuitry associatesthe one data buffer with one of the context buffers holding the onechannel descriptor to maintain the correlation between the onecommunication packet and the one channel descriptor. The co-processorcircuitry prevents multiple valid copies of the one channel descriptorfrom existing in the context buffers. In some examples of the invention,this is accomplished by tracking a number of the data buffers associatedwith the one context buffer. The core processor executes a packetprocessing software application that directs the processor to processthe one communication packet in the one data buffer based on the onechannel descriptor in the one context buffer.

In some examples of the invention, the co-processor circuitry determinesif the one channel descriptor already exists in the context buffers andis valid. If not, the co-processor circuitry transfers the one channeldescriptor from off-chip memory to the one context buffer. If so, theco-processor circuitry does not transfer the one channel descriptor fromthe off-chip memory. The co-processor circuitry sets an in-use count anda validity indicator in response to transferring the one channeldescriptor from the off-chip memory to the one context buffer. Thein-use count tracks the number of the data buffers associated with theone context buffer. The validity indicator indicates that the onechannel descriptor in the one context buffer is valid. The co-processorcircuitry increments the in-use count if the one channel descriptor isalready in the one context buffer and is valid. After processing by thecore processor, the co-processor circuitry transfers the onecommunication packet from the one data buffer, and in response,decrements the in-use count. If none of the data buffers are associatedwith the one channel descriptor, the co-processor circuitry clears thevalidity indicator, and transfers the one channel descriptor to theoff-chip memory.

DESCRIPTION OF THE DRAWINGS

The same reference number represents the same element on all drawings.

FIG. 1 is a block diagram that illustrates a packet processingintegrated circuit in an example of the invention.

FIG. 2 is a block diagram that illustrates packet processing stages andpipe-lining in an example of the invention.

FIG. 3 is a block diagram that illustrates co-processor circuitry in anexample of the invention.

FIG. 4 is a flow diagram that illustrates buffer correlation and in-usecounts in an example of the invention.

FIG. 5 is a block diagram that illustrates buffer management circuitryin an example of the invention.

FIG. 6 is a table that illustrates buffer classes in an example of theinvention.

FIG. 7 is a block diagram that illustrates scheduler circuitry in anexample of the invention.

FIG. 8 is block diagram that illustrates a scheduling board in anexample of the invention.

FIG. 9 is block diagram that illustrates a scheduling board in anexample of the invention.

DETAILED DESCRIPTION OF THE INVENTION

Packet Processing Integrated Circuit—FIG. 1

FIG. 1 depicts a specific example of an integrated circuit in accordwith the present invention. Those skilled in the art will appreciatenumerous variations from this example that do not depart from the scopeof the invention. Those skilled in the art will also appreciate thatvarious features could be combined to form multiple variations of theinvention. Those skilled in the art will appreciate that someconventional aspects of FIG. 1 have been simplified or omitted forclarity. Various aspects of packet processing integrated circuits arediscussed in U.S. Pat. No. 5,748,630, entitled “ASYNCHRONOUS TRANSFERMODE CELL PROCESSING WITH LOAD MULTIPLE INSTRUCTION AND MEMORYWRITE-BACK”, filed May 9, 1996, and which is hereby incorporated byreference into this application.

FIG. 1 is a block diagram that illustrates packet processing integratedcircuit 100 in an example of the invention. Integrated circuit 100comprises core processor 104, scheduler 105, receive interface 106,co-processor circuitry 107, transmit interface 108, and memory interface109. These components may be interconnected through a memory crossbar orsome other type of internal interface. Receive interface 106 is coupledto communication system 101. Transmit interface 108 is coupled tocommunication system 102. Memory interface is coupled to memory 103.

Communication system 101 could be any device that supplies communicationpackets with one example being the switching fabric in an AsynchronousTransfer Mode (ATM) switch. Communication system 101 could be any devicethat receives communication packets with one example being the physicalline interface in the ATM switch. Memory 103 could be any memory devicewith one example being Random Access Memory (RAM) integrated circuits.Receive interface 106 could be any circuitry configured to receivepackets with some examples including UTOPIA interfaces or PeripheralComponent Interconnect (PCI) interfaces. Transmit interface 108 could beany circuitry configured to transfer packets with some examplesincluding UTOPIA interfaces or PCI interfaces.

Core processor 104 is a micro-processor that executes networkingapplication software. Core-processor 104 supports an instruction setthat has been tuned for networking operations—especially contextswitching. In some examples of the invention, core processor 104 has thefollowing characteristics: 132 MHz, pipelined single-cycle operation,RISC-based design, 32-bit instruction and register set, 4K instructioncache, 8 KB zero-latency scratchpad memory, interrupt/trap/halt support,and C compiler readiness.

Scheduler 105 comprises circuitry configured to schedule and initiatepacket processing that typically results in packet transmissions fromintegrated circuit 100, although scheduler 105 may also schedule andinitiate other activities. Scheduler 105 schedules upcoming events, andas time passes, selects scheduled events for processing and re-schedulesunprocessed events. Scheduler 105 transfers processing requests forselected events to co-processor circuitry 107. Scheduler 105 can handlemultiple independent schedules to provide prioritized scheduling acrossmultiple traffic streams. To provide scheduling, scheduler 105 mayexecute a guaranteed cell rate algorithm to implement a leaky bucket ora token bucket scheduling system. The guaranteed cell rate algorithm isimplemented through a cache that holds algorithm parameters. Scheduler105 is described in detail with respect to FIGS. 7-9.

Co-processor circuitry 107 receives communication packets from receiveinterface 106 and memory interface 109 and stores the packets ininternal data buffers. Co-processor circuitry 107 correlates each packetto context information describing how the packet should be handled.Co-processor circuitry 107 stores the correlated context information ininternal context buffers and associates individual data buffers withindividual context buffers to maintain the correlation betweenindividual packets and context information. Importantly, co-processorcircuitry 107 ensures that only one copy of the correlated contextinformation is present the context buffers to maintain coherency.Multiple data buffers are associated with a single context buffer tomaintain the correlation between the multiple packets and the singlecopy the context information.

Co-processor circuitry 107 also determines a prioritized processingorder for core processor 104. The prioritized processing order controlsthe sequence in which core processor 104 handles the communicationpackets. The prioritized processing order is typically based on theavailability of all of the resources and information that are requiredby core processor 104 to process a given communication packet. Resourcestate bits are set when resources become available, so co-processorcircuitry 107 may determine when all of these resources are available byprocessing the resource state bits. If desired, the prioritizedprocessing order may be based on information in packet handlingrequests. Co-processor circuitry 107 selects scheduling algorithms basedon an internal scheduling state bits and uses the selected schedulingalgorithms to determine the prioritized processing order. The algorithmscould be round robin, service-to-completion, weighted fair queuing,simple fairness, first-come first-serve, allocation through prioritypromotion, software override, or some other arbitration scheme. Thus,the prioritization technique used by co-processor circuitry 107 isexternally controllable. Co-processor circuitry 107 is described in moredetail with respect to FIGS. 2-4.

Memory interface 109 comprises circuitry configured to exchange packetswith external buffers in memory 103. Memory interface 109 maintains apointer cache that holds pointers to the external buffers. Memoryinterface 109 allocates the external buffers when entities, such as coreprocessor 104 or co-processor circuitry 107, read pointers from thepointer cache. Memory interface 109 de-allocates the external bufferswhen the entities write the pointers to the pointer cache.Advantageously, external buffer allocation and de-allocation isavailable through an on-chip cache read/write. Memory interface 109 alsomanages various external buffer classes, and handles conditions such asexternal buffer exhaustion. Memory interface 109 is described in detailwith respect to FIGS. 5-6.

In operation, receive interface 106 receives new packets fromcommunication system 101, and scheduler 105 initiates transmissions ofpreviously received packets that are typically stored in memory 103. Toinitiate packet handling, receive interface 106 and scheduler 105transfer requests to co-processor circuitry 107. Under software control,core processor 104 may also request packet handling from co-processorcircuitry 107. Co-processor circuitry 107 fields the requests,correlates the packets with their respective context information, andcreates a prioritized work queue for core processor 104. Core processor104 processes the packets and context information in order from theprioritized work queue. Advantageously, co-processor circuitry 107operates in parallel with core processor 104 to offload the contextcorrelation and prioritization tasks to conserve important coreprocessing capacity.

In response to packet handling, core processor 104 typically initiatespacket transfers to either memory 103 or communication system 102. Ifthe packet is transferred to memory 103, then core processor instructsscheduler 105 to schedule and initiate future packet transmission orprocessing. Advantageously, scheduler 105 operates in parallel with coreprocessor 104 to offload scheduling tasks and conserve important coreprocessing capacity.

Various data paths are used in response to core processor 104 packettransfer instructions. Co-processor circuitry 107 transfers packetsdirectly to communication system 102 through transmit interface 108.Co-processor circuitry 107 transfers packets to memory 103 throughmemory interface 109 with an on-chip pointer cache. Memory interface 109transfers packets from memory 103 to communication system 102 throughtransmit interface 108. Co-processor circuitry 107 transfers contextinformation from a context buffer through memory interface 109 to memory103 if there are no packets in the data buffers that are correlated withthe context information in the context buffer. Advantageously, memoryinterface 109 operates in parallel with core processor 104 to offloadexternal memory management tasks and conserve important core processingcapacity.

Co-processor Circuitry—FIGS. 2-4

FIGS. 2-4 depict a specific example of co-processor circuitry in accordwith the present invention. Those skilled in the art will appreciatenumerous variations from this example that do not depart from the scopeof the invention. Those skilled in the art will also appreciate thatvarious features could be combined to form multiple variations of theinvention. Those skilled in the art will appreciate that someconventional aspects of FIGS. 2-4 have been simplified or omitted forclarity.

FIG. 2 demonstrates how co-processor circuitry 107 provides pipe-linedoperation. FIG. 2 is vertically separated by dashed lines that indicatefive packet processing stages: 1) context resolution, 2) contextfetching, 3) priority queuing, 4) software application, and 5) contextflushing. Co-processor circuitry 107 handles stages 1-3 to providehardware acceleration. Core processor 104 handles stage 4 to providesoftware control with optimized efficiency due to stages 1-3.Co-processor circuitry 107 also handles stage 5. Co-processor circuitry107 has eight pipelines through stages 1-3 and 5 to concurrently processmultiple packet streams.

In stage 1, requests to handle packets are resolved to a context foreach packet in the internal data buffers. The requests are generated byreceive interface 106, scheduler 105, and core processor 104 in responseto incoming packets, scheduled transmissions, and application softwareinstructions. The context information includes a channel descriptor thathas information regarding how packets in one of 64,000 differentchannels are to be handled. For example, a channel descriptor mayindicate service address information, traffic management parameters,channel status, stream queue information, and thread status. Thus,64,000 channels with different characteristics are available to supporta wide array of service differentiation. Channel descriptors areidentified by channel identifiers. Channel identifiers may be indicatedby the request. A map may be used to translate selected bits from thepacket header to a channel identifier. A hardware engine may alsoperform a sophisticated search for the channel identifier based onvarious information. Different algorithms that calculate the channelidentifier from the various information may be selected by settingcorrelation state bits in co-processor circuitry 107. Thus, thetechnique used for context resolution is externally controllable.

In stage 2, context information is fetched, if necessary, by using thechannel identifiers to transfer the channel descriptors to internalcontext buffers. Prior to the It transfer, the context buffers are firstchecked for a matching channel identifier and validity bit. If a matchis found, then the context buffer with the existing channel descriptoris associated with the corresponding internal data buffer holding thepacket.

In stage 3, requests with available context are prioritized andarbitrated for core processor 104 handling. The priority may beindicated by the request—and it may be the source of the request. Thepriority queues 1-8 are 16 entries deep. Priority queues 1-8 are alsoranked in a priority order by queue number. The priority for eachrequest is determined, and when the context and data buffers for therequest are valid, an entry for the request is placed in one of thepriority queues that corresponds to the determined priority. The entriesin the priority queues point to a pending request state RAM thatcontains state information for each data buffer. The state informationincludes a data buffer pointer, a context pointer, context validity bit,requester indicator, port status, a channel descriptor loaded indicator.

The work queue indicates the selected priority queue entry that coreprocessor 104 should handle next. To get to the work queue, the requestsin priority queues are arbitrated using one of various algorithms suchas round robin, service-to-completion, weighted fair queuing, simplefairness, first-come first-serve, allocation through priority promotion,and software override. The algorithms may be selected through schedulingstate bits in co-processor circuitry 107. Thus, the technique used forprioritization is externally controllable. Co-processor circuitry 107loads core processor 104 registers with the channel descriptorinformation for the next entry in the work queue.

In stage 4, core processor 104 executes the software application toprocess the next entry in the work queue which points to a portion ofthe pending state request RAM that identifies the data buffer andcontext buffer. The context buffer indicates one or more serviceaddresses that direct the core processor to the proper functions withinthe software application. One such function of the software applicationis traffic shaping to conform to service level agreements. Otherfunctions include header manipulation and translation, queuingalgorithms, statistical accounting, buffer management, interworking,header encapsulation or stripping, cyclic redundancy checking,segmentation and reassembly, frame relay formatting, multicasting, androuting. Any context information changes made by the core processor arelinked back to the context buffer in real time.

In stage 5, context is flushed. Typically, core processor 104 instructsco-processor circuitry 107 to transfer packets to off-chip memory 103 ortransmit interface 108. If no other data buffers are currentlyassociated with the pertinent context information, then co-processorcircuitry 107 transfers the context information to off-chip memory 103.

FIG. 3 is a block diagram that illustrates co-processor circuitry 107 inan example of the invention. Co-processor circuitry 107 comprises ahardware engine that is firmware-programmable in that it operates inresponse to state bits and register content. In contrast, core processor104 is a micro-processor that executes application software.Co-processor circuitry 107 operates in parallel with core processor 104to conserve core processor capacity by off-loading numerous tasks fromthe core processor.

Co-processor circuitry 107 comprises context resolution 310, control311, arbiter 312, priority queues 313, data buffers 314, context buffers315, context DMA 316, and data DMA 317. Data buffers 314 hold packetsand context buffers 315 hold context information, such as a channeldescriptor. Data buffers 314 are relatively small and of a fixed size,such as 64 bytes, so if the packets are ATM cells, each data bufferholds only a single ATM cell and ATM cells do not cross data bufferboundaries.

Individual data buffers 314 are associated with individual contextbuffers 315 as indicated by the downward arrows. Priority queues 313hold entries that represent individual data buffers 314 as indicated bythe upward arrows. Thus, a packet in one of the data buffers isassociated with its context information in an associated one of thecontext buffers 315 and with an entry in priority queues 313. Arbiter312 presents a next entry from priority queues 313 to core processor 104which handles the associated packet in the order determined by arbiter312.

Context DMA 316 exchanges context information between memory 103 andcontext buffers 315 through memory interface 109. Context DMAautomatically updates queue pointers in the context information. DataDMA 317 exchanges packets between data buffers 314 and memory 103through memory interface 109. Data DMA 317 also transfers packets frommemory 103 to transmit interface 108 through memory interface 109. DataDMA 317 signals context DMA 316 when transferring packets off-chip, andcontext DMA 316 determines if the associated context should betransferred to off-chip memory 103. Both DMAs 316-317 may be configuredto perform CRC calculations.

For a new packet from communication system 101, control 311 receives thenew packet and a request to handle the new packet from receive interface106. Control 311 receives and places the packet in one of the databuffers 314 and transfers the packet header to context resolution 310.Based on gap state bits, a gap in the packet may be created between theheader and the payload in the data buffer, so core processor 104 cansubsequently write encapsulation information to the gap without havingto create the gap. Context resolution 310 processes the packet header tocorrelate the packet with a channel descriptor—although in some cases,receive interface 106 may have already performed this contextresolution. The channel descriptor comprises information regardingpacket transfer over a channel.

Control 311 determines if the channel descriptor that has beencorrelated with the packet is already in one of the context buffers 315and is valid. If so, control 311 does not request the channel descriptorfrom off-chip memory 103. Instead, control 311 associates the particulardata buffer 314 holding the new packet with the particular contextbuffer 315 that already holds the correlated channel descriptor. Thisprevents multiple copies of the channel descriptor from existing incontext buffers 314. Control 311 then increments an in-use count for thechannel descriptor to track the number of data buffers 314 that areassociated with the same channel descriptor. If the correlated channeldescriptor is not in context buffers 315, then control 311 requests thechannel descriptor from context DMA 316. Context DMA 316 transfers therequested channel descriptor from off-chip memory 103 to one of thecontext buffers 315 using the channel descriptor identifier, which maybe an address, that was determined during context resolution. Control311 associates the context buffer 315 holding the transferred channeldescriptor with the data buffer 314 holding the new packet to maintainthe correlation between the new packet and the channel descriptor.Control 311 also sets the in-use count for the transferred channeldescriptor to one and sets the validity bit to indicate contextinformation validity.

Control 311 also determines a priority for the new packet. The prioritymay be determined by the source of the new packet, header information,or channel descriptor. Control 311 places an entry in one of priorityqueues 313 based on the priority. The entry indicates the data buffer314 that has the new packet. Arbiter 312 implements an arbitrationscheme to select the next entry for core processor 104. Core processor104 reads the next entry and processes the associated packet and channeldescriptor in the particular data buffer 314 and context buffer 315indicated in the next entry.

Each priority queue has a service-to-completion bit and a sleep bit.When the service-to-completion bit is set, the priority queue has ahigher priority that any priority queues without theservice-to-completion bit set. When the sleep bit is set, the priorityqueues is not processed until the sleep bit is cleared. The ranking ofthe priority queue number breaks priority ties. Each priority queue hasa weight from 0-15 to ensure a certain percentage of core processorhandling. After an entry from a priority queue is handled, its weight isdecremented by one if the service-to-completion bit is not set. Theweights are re-initialized to a default value after 128 requests havebeen handled or if all weights are zero. Each priority queue has a highand low watermark. When outstanding requests that are entered in apriority queue exceed its high watermark, the service-to-completion bitis set. When the outstanding requests fall to the low watermark, theservice-to-completion bit is cleared. The high watermark is typicallyset at the number of data buffers allocated to the priority queue.

Core processor 104 may instruct control 311 to transfer the packet tooff-chip memory 103 through data DMA 317. Control 311 decrements thecontext buffer in-use count, and if the in-use count is zero (no databuffers 314 are associated with the context buffer 315 holding thechannel descriptor), then control 311 instructs context DMA 316 totransfer the channel descriptor to off-chip memory 103. Control 311 alsoclears the validity bit. This same general procedure is followed whenscheduler 105 requests packet transmission, except that in response tothe request from scheduler 105, control 311 instructs data DMA 317 totransfer the packet from memory 103 to one of data buffers 314.

FIG. 4 is a flow diagram that illustrates the operation of co-processorcircuitry 107 when correlating buffers in an example of the invention.Co-processor circuitry 107 has eight pipelines to concurrently processmultiple packet streams in accord with FIG. 3. First, a packet is storedin a data buffer, and the packet is correlated to a channel descriptoras identified by a channel identifier. The channel descriptor comprisesthe context information regarding how packets in one of 64,000 differentchannels are to be handled.

Next, context buffers 314 are checked for a valid version of thecorrelated channel descriptor. This entails matching the correlatedchannel identifier with a channel identifier in a context buffer that isvalid. If the correlated channel descriptor is not in a context bufferthat is valid, then the channel descriptor is retrieved from memory 103and stored in a context buffer using the channel identifier. The databuffer holding the packet is associated with the context buffer holdingthe transferred channel descriptor. An in-use count for the contextbuffer holding the channel descriptor is set to one. A validity bit forthe context buffer is set to indicate that the channel descriptor in thecontext buffer is valid. If the correlated channel descriptor is alreadyin a context buffer that is valid, then the data buffer holding thepacket is associated with the context buffer already holding the channeldescriptor. The in-use count for the context buffer holding the channeldescriptor is incremented.

Typically, core processor 104 instructs co-processor circuitry 107 totransfer packets to off-chip memory 103 or transmit interface 108. DataDMA 317 transfers the packet and signals context DMA 316 when finished.Context DMA 316 decrements the in-use count for the context bufferholding the channel descriptor, and if the decremented in-use countequals zero, then context DMA 316 transfers the channel descriptor tomemory 103 and clears the validity bit for the context buffer.

Memory Interface 109—FIGS. 5-6

FIGS. 5-6 depict a specific example of memory interface circuitry inaccord with the present invention. Those skilled in the art willappreciate numerous variations from this example that do not depart fromthe scope of the invention. Those skilled in the art will alsoappreciate that various features could be combined to form multiplevariations of the invention. Those skilled in the art will appreciatethat some conventional aspects of FIGS. 5-6 have been simplified oromitted for clarity.

FIG. 5 is a block diagram that illustrates memory interface 109 in anexample of the invention. Memory interface 109 comprises a hardwarecircuitry engine that is firmware-programmable in that it operates inresponse to state bits and register content. In contrast, core processor104 is a micro-processor that executes application software. Memoryinterface 109 operates in parallel with core processor 104 to conservecore processor capacity by off-loading numerous tasks from the coreprocessor.

From FIG. 1, FIG. 5 shows memory 103, core processor 104, co-processorcircuitry 107, transmit interface 108, and memory interface 109. Memory103 comprises Static RAM (SRAM) 525 and Synchronous Dynamic RAM (SDRAM)526, although other memory systems could be used in other examples ofthe invention. SDRAM 526 comprises pointer stack 527 and externalbuffers 528. Memory interface 109 comprises buffer management engine520, SRAM interface 521, and SDRAM interface 522. Buffer managementengine 520 comprises pointer cache 523 and control logic 524.

Conventional components could be used for SRAM interface 521, SDRAMinterface 522, SRAM 525, and SDRAM 526. SRAM interface 521 exchangescontext information between SRAM 525 and co-processor circuitry 107.External buffers 528 use a linked list mechanism to store communicationpackets externally to integrated circuit 100. Pointer stack 527 is acache of pointers to free external buffers 528 that is initially builtby core processor 104. Pointer cache 523 stores pointers that weretransferred from pointer stack 527 and correspond to external buffers528. Sets of pointers may be periodically exchanged between pointerstack 527 and pointer cache 523. Typically, the exchange from stack 527to cache 523 operates on a first-in/first-out basis.

In operation, core processor 104 writes pointers to free externalbuffers 528 to pointer stack 527 in SDRAM 526. Through SDRAM interface522, control logic 524 transfers a subset of these pointers to pointercache 523. When an entity, such as core processor 104, co-processorcircuitry 107, or an external system, needs to store a packet in memory103, the entity reads a pointer from pointer cache 523 and uses thepointer to transfer the packet to external buffers 528 through SDRAMinterface 522. Control logic 524 allocates the external buffer as thecorresponding pointer is read from pointer cache 523. SDRAM stores thepacket in the external buffer indicated by the pointer. Allocation meansto reserve the buffer, so other entities do not improperly write to itwhile it is allocated.

When the entity no longer needs the external buffer—for example, thepacket is transferred from memory 103 through SDRAM interface 522 toco-processor circuitry 107 or transmit interface 108—then the entitywrites the pointer to pointer cache 523. Control logic 524 de-allocatesthe external buffer as the corresponding pointer is written to pointercache 523. De-allocation means to release the buffer, so other entitiesmay reserve it. The allocation and de-allocation process is repeated forother external buffers 528.

Control logic 524 tracks the number of the pointers in pointer cache 523that point to de-allocated external buffers 528. If the number reaches aminimum threshold, then control logic 524 transfers additional pointersfrom pointer stack 527 to pointer cache 523. Control logic 524 may alsotransfer an exhaustion signal to core processor 104 in this situation.If the number reaches a maximum threshold, then control logic 524transfers an excess portion of the pointers from pointer cache 523 topointer stack 527.

FIG. 6 is a table that illustrates buffer classes in an example of theinvention. In the example of FIG. 6, there are 16 classes with 500external buffers each for a total of 8,000 external buffers. Each classhas a type: static, exclusive, or shared. Static classes use their ownexternal buffers without sharing. Exclusive classes use their ownexternal buffers first, and then borrow external buffers from thefail-over classes. De-allocated external buffers from a given exclusiveclass are credited to the associated fail-over class until the number ofborrowed external buffers is zero. Shared classes use their own externalbuffers and comprise the fail-over external buffers for the exclusiveclass.

Buffer classes are used to differentiate services among traffic streamsby assigning different streams to different classes of external buffers.Traffic streams offering a higher quality-of-service are typicallyprovided with greater access to external buffers. Bursty traffic mayneed an elastic exclusive/shared class arrangement. A class may beassociated with only one type of traffic, such as Constant Bit Rate(CBR), Available Bit Rate (ABR), Variable Bit Rate (VBR), or UnspecifiedBit Rate (UBR). CBR traffic without bursts typically uses staticclasses. ABR traffic uses exclusive and shared external buffer classesto respectively handle minimum cell rates and bursts. VBR and UBRtraffic typically use shared buffer classes.

The external buffers are separated into two separately managed pools Aand B. Pools can be used for service differentiation. Pools are alsohelpful when the external buffers are located in separate memorydevices, so each device may have its own independently managed pool.

For each class, control logic 524 tracks the number of pointers inpointer cache 523 that point to the de-allocated external buffers andthe number of pointers in pointer cache 523 that point to the allocatedexternal buffers. If the number of pointers to the de-allocated externalbuffers in one of the classes reaches a minimum threshold for thatclass, control logic 524 transfers an exhaustion signal for that classto core processor 104. If the class is exclusive, control logic 524 mayalso borrow pointers from the corresponding fail-over class for use bythe exclusive class, although conditions and thresholds may be used tolimit the amount of borrowing. Control logic 524 tracks the number ofpointers distributed to each class and may re-distribute pointers fromone class to another based on certain conditions, such as traffic loads.In addition, more ABR traffic may require more exclusive buffers at theexpense of shared buffers where more UBR traffic has the oppositeeffect.

Scheduler Circuitry—FIGS. 7-9

FIGS. 7-9 depict a specific example of scheduler circuitry in accordwith the present invention. Those skilled in the art will appreciatenumerous variations from this example that do not depart from the scopeof the invention. Those skilled in the art will also appreciate thatvarious features could be combined to form multiple variations of theinvention. Those skilled in the art will appreciate that someconventional aspects of FIGS. 7-9 have been simplified or omitted forclarity.

FIG. 7 is a block diagram that illustrates scheduler 105 in an exampleof the invention. Scheduler 105 comprises a hardware circuitry enginethat is firmware-programmable in that it operates in response to statebits and register content. In contrast, core processor 104 is amicro-processor that executes application software. Scheduler 105operates in parallel with core processor 104 to conserve core processorcapacity by off-loading numerous tasks from the core processor.

Scheduler 105 comprises control logic 730, scheduling boards 731-732,and context RAM 735. Board 731 is vertically separated into time periods741-745 where a “1” indicates a reservation at that time period and a“0” indicates no reservation at that time period. Board 731 ishorizontally separated into priority levels 751-754 that are ranked fromhigh at priority level #1 to low at priority level #4. Board 732 issimilar to board 731, but has two priority levels and ten time periods.Control logic 730 process boards 731-732 independently of one another.

Context RAM 735 has entries 736 that each hold one of thousands ofpossible channel descriptor identifiers. The channel descriptors thatcorrespond to these identifiers describe how packet transmission shouldbe handled for a channel. For example, a channel descriptor indicateswhere packets for the channel are stored and how frequently they shouldbe transmitted. Boards 731-732 are each associated with a differentportion of context RAM 735. As indicated by the arrows, each time periodat each priority level on each board is associated with its own one ofthe context RAM entries 736, and thus, with a possibly unique channeldescriptor. To serve a reservation, control logic 730 sends a requestthat identifies the corresponding channel descriptor to co-processorcircuitry 107.

In some examples of the invention, there are 64,000 channel descriptors,and thus, 64,000 corresponding board time periods. The 64,000 timeperiods can be distributed among boards in various combinations of2,000, 4,000, 8,000, 16,000, 32,000, or 64,000 time periods per board.Boards can be separated into 1, 2, or, 4 priority levels that runconcurrently in time. Each priority level uses up time periods, so an8,000 time period board with four priority levels has 2,000 time periodsper priority level that run concurrently. The minimum number ofreservations in a given priority level is 512.

FIGS. 8-9 are block diagrams that illustrate scheduling board 731 in anexample of the invention. Board 731 includes five time periods 741-745and four priority levels 751-754. Fence 860 indicates the time periodthat control logic 730 is currently processing in each priority level.Control logic 730 processes board 731 to serve reservations and initiatepacket transmissions at regular time intervals. At each time interval,referred to as a “GET”, control logic 730 gets one reservation andadvances fence 860. At a GET, fence 860 may advance in some prioritylevels but not others. As a result, fence 860 may be at different timeperiods in different priority levels.

At a GET, control logic 730 serves the highest priority reservation atfence 860. Control logic 860 then advances fence 860 to the next timeperiod in the priority level that is served. Control logic 860 alsoadvances fence 860 to the next time period in other priority levels thatdid not have a reservation at fence 860. Control logic 860 does notadvance fence 860 at priority levels that had an un-served reservationat fence 860.

On FIG. 8, fence 860 is at time period 3 for all priority levels, andpriority level 1 is served, priority level 2 is un-served, and prioritylevels 3 and 4 are not reserved. As a result and as shown on FIG. 9,fence 860 is advanced to time period 4 at priority levels 1, 3, and 4,but not at priority level 2. Priority level 2 will have the highestpriority reservation at the next GET, because fence 860 remains at timeperiod 3 in priority level 2, and priority level 1 has no reservation attime period 4.

The various scheduling boards and priority levels provide a robustmechanism for differentiating services between traffic streams based onservice level agreements. For example, the highest priority level ofboard 732 could be traffic with a guaranteed bandwidth rate, and thelower priority level could be traffic without any bandwidth guarantee.Board 731 has four priority levels and may have Constant Bit Rate (CBR)traffic at the highest priority, real time Variable Bit Rate (VBR)traffic at the second-highest priority, non-real-time VBR traffic at thethird-highest priority level, and Available Bit Rate (ABR) traffic atthe fourth and lowest priority level. Traffic can also be allocatedamong boards to provide expensive high-quality service from one board,and cheap moderate-quality service from another board. Prioritizationcircuitry within co-processor circuitry 107 can assign channels on thehigh-quality board to the highest priority queue to core processor 104and assign channels on the moderate-quality board to the highestpriority queue to core processor 104.

A board stall occurs when a higher priority level starves a lowerpriority level, and a reservation at the lower priority level will neverget served. In a board stall, control logic 730 does not advance fence860 until the stall is cured. If a force option is selected, theindicated priority level is serviced at the next GET. If a scan optionis selected, the above-described board processing is modified. Allreservations in the highest priority level are serviced before any lowerpriority levels are serviced. In lower priority levels during this time,fence 860 is advanced at a GET if the time period is not reserved. Thescan process repeats for the next highest priority level down throughthe lowest priority level.

Control logic 730 schedules a reservation in response to a “PUT”generated by core processor 104 or scheduler 105. Control logic 730schedules the reservation by determining a start position. The startposition is a number of time periods from the current fence locationwhere the search starts for an available time period for thereservation. The start position may be specified in the PUT, or it maybe calculated by control logic 730.

To calculate the start position, control logic 730 first retrievesscheduling parameters from the proper context buffer in co-processorcircuitry 107 using a pointer in the PUT. Control logic 730 alsoincrements the in-use count for the context buffer. Control logic 730then executes dual Guaranteed Cell Rate (GCR) scheduling algorithmsbased on the scheduling parameters to determine the start position.

The scheduling parameters include a scheduling board indicator, firstchoice priority level, and second choice priority level that is a higherpriority than the first choice. If the first priority level does notwork for some reason, then the second priority level is attempted in apriority promotion. In a priority promotion, the control logic 730 triesto find a reservation based on the Minimum Cell Rate (MCR), and ifnothing is available, then control logic 730 tries to find a reservationbased on the Peak Cell Rate (PCR).

The scheduling parameters also include usage values that determine howthe dual algorithms are used. Based on the usage values, algorithm 1 andalgorithm 2 are respectively be used for:

PCR/nothing

MCR/PCR, or

Sustained Cell Rate (SCR)/PCR.

For algorithm 1 and algorithm 2, the scheduling parameters respectivelyinclude:

Theoretical Arrival Times (TAT1/TAT2),

Inter-Cell Intervals (ICI1 ICI2), and limits (L1/L2).

The TATs are the expected arrival times, and the ICIs are the transmitfrequencies. TATs are re-initialized if a reservation has been inactivefor a long time (about one second).

The two scheduling algorithms are specified by the following psuedocodewhere PT_(t) is the present time, TAT1 _(t−1), TAT2 _(t−1) are old timesread from the context buffer, and TAT1 _(t), TAT2 _(t) are new timeswritten to the context buffer.

if (PUT w/ no update instruction) { ICI1 = 0 ICI2 = 0 PIPELAT = 0 } //else PUT with update; use the ICIs as provided TAT2_(t) = max(TAT2_(t−1) + ICI2, PT_(t) + ICI2) if (ALG==MCR/PCR) TAT1_(start) = max(PT_(t) − L1, min (TAT1_(t−1) + ICI1, PT_(t) + L1)) else TAT1_(start) =max (TAT1_(t−1 + ICI1, PT) _(t) + ICI1) if (ALG==PCR/none) { startposition = max (0, TAT1_(t) − L1 − PT_(t)) } else if (ALG==SCR/PCR) {start position = max (0, TAT2_(t) − L2 − PT_(t) , TAT1_(t) − L1 −PT_(t)) } else if (ALG==MCR/PCR) { start position = max (0, TAT2_(t) −L2 − PT_(t)) } TAT2_(t) = max (TAT2_(start), landing position + PT_(t))if (ALG==MCR/PCR) TAT1_(t) = TAT1_(start) else TAT1_(t) = max(TAT1_(start), landing position + PT_(t)) if (PUT with writeinstruction) { write TAT1_(t), TAT2_(t), back to context buffer }decrement in-use count.

In addition to determining the starting position, control logic 730determines the board configuration, fence location, and the oldestreservation at the fence in each priority level. Control logic 730locates the start position from the fence at the selected priority leveland on the selected scheduling board. Control logic 730 then searchesfor an available reservation time period. If the time period at thestart time is already reserved, then the next available time period isreserved.

The number of time periods between the fence and the reserved timeperiod is referred to as the landing position. The landing position mustbe smaller than the board to avoid wrapping around the board andreserving a time period that is improperly close to the fence. It may bethe case that the priority level is full and reservations only open upas the fence is advanced. In this situation, any PUT will be reservedjust behind the advancing fence.

Once the reservation is made, the applicable channel descriptoridentifier is placed in the corresponding entry in context RAM 735. Thescheduling parameters may also be updated and written back to thecontext buffer. The in-use count for the context buffer is decremented.

Those skilled in the art will appreciate variations of theabove-described embodiments that fall within the scope of the invention.As a result, the invention is not limited to the specific examples andillustrations discussed above, but only by the following claims andtheir equivalents.

What is claimed is:
 1. An integrated circuit that processescommunication packets, the integrated circuit comprising: co-processorcircuitry comprising context buffers and data buffers and configured toreceive and store one of the communication packets in one of the databuffers, correlate the one communication packet with one of a pluralityof channel descriptors, associate the one data buffer with one of thecontext buffers holding the one channel descriptor to maintain thecorrelation between the one communication packet and the one channeldescriptor, and prevent multiple valid copies of the one channeldescriptor from existing in the context buffers; the co-processorcircuitry configured to track a number of the data buffers associatedwith the one context buffer; the co-processor circuitry configured todetermine if the one channel descriptor already exists in the contextbuffers and is valid, and if not, to transfer the one channel descriptorfrom off-chip memory to the one context buffer, and if so, to nottransfer the one channel descriptor from the off-chip memory; theco-processor circuitry configured to set an in-use count and a validityindicator in response to transferring the one channel descriptor fromthe off-chip memory to the one context buffer wherein the in-use counttracks the number of the data buffers associated with the one contextbuffer and the validity indicator indicates that the one channeldescriptor in the one context buffer is valid; the co-processorcircuitry configured to increment the in-use count if the one channeldescriptor is already in the one context buffer and is valid; theco-processor circuitry configured to transfer the one communicationpacket from the one data buffer, and in response, to decrement thein-use count; in response to transferring the one communication packetfrom the one data buffer, the co-processor circuitry is configured toclear the validity indicator and transfer the one channel descriptor tothe off-chip memory if none of the data buffers are associated with theone channel descriptor; and a core processor configured to execute apacket processing software application that directs the core processorto process the one communication packet in the one data buffer based onthe one channel descriptor in the one context buffer.
 2. The integratedcircuit of claim 1 wherein the co-processor circuitry is configured toselect a correlation algorithm based on internal correlation state bitsand use the selected correlation algorithm to correlate the onecommunication packet with the one channel descriptor.
 3. The integratedcircuit of claim 1 wherein packets are ATM cells and each of the databuffers is configured to hold only a single one of the ATM cells.
 4. Theintegrated circuit of claim 1 wherein the co-processor circuitry isconfigured to operate in parallel with the core processor.
 5. A methodof operating an integrated circuit that process communication packets,the method comprising: in co-processor circuitry comprising contextbuffers and data buffers, and receiving and storing one of thecommunication packets in one of the data buffers; in the co-processorcircuitry, correlating the one communication packet with one of aplurality of channel descriptors; in the co processor circuitry,associating the one data buffer with one of the context buffers holdingthe one channel descriptor to maintain the correlation between the onecommunication packet and the one channel descriptor; in the co-processorcircuitry, preventing multiple valid copies of the one channeldescriptor from existing in the context buffers; wherein preventing themultiple valid copies of the one channel descriptor from existing in thecontext buffers comprises tracking a number of the data buffersassociated with the one context buffer; wherein tracking the number ofthe data buffers associated with the one context buffer comprisessetting an in-use count and a validity indicator in response totransferring the one channel descriptor from the off-chip memory to theone context buffer wherein the in-use count tracks the number of thedata buffers associated with the one context buffer and the validityindicator indicates that the one channel descriptor in the one contextbuffer is valid; wherein tracking the umber of the data buffersassociated with the one context buffer comprises incrementing the in-usecount if the one channel descriptor is already in the one context bufferand is valid; in the co-processor circuitry determining if the onechannel descriptor already exists in the context buffers and is valid;if not, then transferring the one channel descriptor from off-chipmemory to the one context buffet; and if so, then not transferring theone channel descriptor from the off-chip memory; transferring the onecommunication packet from the one data buffer, and wherein tracking thenumber of the data buffers associated with the one context buffercomprises, decrementing the in-use count in response to transferring theone communication packet from the one data buffer; wherein tracking thenumber of the data buffers associated with the one context buffercomprises clearing the validity indicator and transferring the onechannel descriptor to the off-chip memory if none of the data buffersare associated with the one channel descriptor; and in a core processor,executing a packet processing software application that directs the coreprocessor to process the one communication packet in the one data bufferbased on the one channel descriptor in the one context buffer.
 6. Themethod of claim 5 further comprising, in the co-processor circuitry,selecting a correlation algorithm based on internal correlation statebits and using the selected correlation algorithm to correlate the onecommunication packet with the one channel descriptor.
 7. The method ofclaim 5 wherein the packets are ATM cells and each of the data buffersis configured to hold only a single one of the ATM cells.
 8. The methodof claims 5 wherein the co-processor circuitry is configured to operatein parallel with the core processor.